
var _Setmenu = function(lanmu,page){
    document.getElementById('sidebar').innerHTML=`
               <li ${lanmu=='nandu1'?`class="active"`:''}> <a href="nandu.html?nd=1">入门难度</a></li>
               <li ${lanmu=='nandu2'?`class="active"`:''}> <a href="nandu.html?nd=2">低难度</a></li>
               <li ${lanmu=='nandu3'?`class="active"`:''}> <a href="nandu.html?nd=3">中难度</a></li>
               <li ${lanmu=='nandu4'?`class="active"`:''}> <a href="nandu.html?nd=4">高难度</a></li>
               <li ${lanmu=='lianxi'?`class="active"`:''}> <a href="lianxi.html">练习设置</a></li>
               <li ${lanmu=='user'?`class="active"`:''}> <a href="user.html">用户管理</a></li>
               <li ${lanmu=='tongji'?`class="active"`:''}> <a href="tongji.html">数据统计</a></li>
               <li><a href="javascript:_Mima()">修改密码</a></li>
               <li><a href="javascript:_exit()">退出登录</a></li>

    `;
};



const _exit = function(){
    //localStorage.clear();
    window.location.href='login.html';
};


const _Mima = function(){
    let str = window.prompt('请输入新密码');
    if(str && str!=""){
        shuju.set('password',str);
        shuju.set('id',mydata.get('aid'));
        shuju.set('biao','admin');
        shuju.getshuju('c/info_xiugai',{
            success:function(data){
                if(data.code==200){
                    toastr.success('修改成功');
                }else{
                    toastr.error('修改失败');
                }
            },
            error:function(e){
                toastr.error('网络错误');
            }
        })
    }
};

